/**
 * @file rscNet.c
 * @brief Short description of this file.
 *
 * Complete description of this file.
 *
 * @date Mar 27, 2012
 * @author Francesco Corvino
 */
#include "rscNet.h"


int RscNet_CmpOperations(const void * a, const void * b){
	int A,B;
	if((a==NULL) && (b==NULL)) return 0;
	if(a!=NULL) A = ((NetOperation*) a)->nsequence; else return -1;
	if(b!=NULL) B = ((NetOperation*) b)->nsequence; else return 1;
	return (A>B)?1:((A==B)?0:-1);
}

void RscNet_init(HostSession * session){
	// inizializza i dati sulle operazioni di rete della sessione
	NetSession netSession;
	DynArray_init(&(netSession.operations), RscNet_CmpOperations,sizeof(NetOperation));

	// salva in memoria della sessione l'oggetto
	CMap_set(&(session->attributes), KEY_NETINFO_INT, &netSession, sizeof(NetSession));
}

void RscNet_addOperation(HostSession * session, NetOperation * op){

}

